import axios from "../utils/axiosUtils";

/**
 * 查询所有分类
 * {parentId:0}
 * params专门针对get请求参数传递， /categroy/findCategroy?parentId=0&name=分类
 */
export const findAllCategory = (data) => {
    return axios.get(`/categroy/findCategroy`, {
        params: data
    })
}

/**
 * 添加分类
 * @param {} data 
 * @returns 
 */
export const addCategory = (data) => {
    return axios.post("/categroy/addCategroy", data)
}

export const findCategoryWithProduct = () => {
    return axios.get("/categroy/findAllCategroy?parentId=0")
}


